package com.ljt.yupictureddd.domain.space.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ljt.yupictureddd.domain.space.entity.Space;
import com.ljt.yupictureddd.domain.user.entity.User;
import com.ljt.yupictureddd.interfaces.dto.space.SpaceAddRequest;
import com.ljt.yupictureddd.interfaces.dto.space.SpaceQueryRequest;
import com.ljt.yupictureddd.interfaces.vo.space.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 六件套
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-03-14 11:06:32
*/
public interface SpaceDomainService extends IService<Space> {
    /**
     * 创建空间
     */
    long createSpace(SpaceAddRequest request, User loginUser);

    /**
     * 获得MybatisPlus查询对象
     *
     * @param request
     * @return
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest request);

    /**
     * 获得SpaceVO
     * @param space
     * @param request
     * @return
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);

    /**
     * 由分页的space对象查出分页的SpaceVO对象(列表查列表)
     *
     * @param page    分页的Space对象
     * @param request
     * @return
     */
    Page<SpaceVO> getSpaceVOList(Page<Space> page, HttpServletRequest request);

    /**
     * 校验图片
     *
     * @param space
     * @param add
     */
    void validSpace(Space space, boolean add);

    /**
     * 根据spacelevel空间等级来填充字段
     */
    void fillSpaceBySpaceLevel(Space space);
}
